//
//  SyneminLTView.m
//  ContactOf0825
//
//  Created by 韩震明 on 15/11/24.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "SyneminLTView.h"
#import <Masonry.h>
// 这个常量,就可以在使用Masonry不必总带着前缀 `mas_`:
#define MAS_SHORTHAND

// 定义这个常量,以支持在 Masonry 语法中自动将基本类型转换为 object 类型:
#define MAS_SHORTHAND_GLOBALS

@implementation SyneminLTView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createLTView];
    }
    return self;
}

- (void)createLTView
{
    
    self.myLabel = [[UILabel alloc] init/*WithFrame:CGRectMake(20, 20, 100, 50)*/];
    [self addSubview:self.myLabel];
    self.myLabel.layer.borderWidth = 1;
    self.myLabel.layer.cornerRadius = 5;
    self.myLabel.textAlignment = NSTextAlignmentCenter;
    
    
    self.myTextField = [[UITextField alloc] init/*WithFrame:CGRectMake(150, 20, 100, 50)*/];
    [self addSubview:self.myTextField];
    self.myTextField.layer.borderWidth = 1;
    self.myTextField.layer.cornerRadius = 5;
    self.myTextField.textAlignment = NSTextAlignmentCenter;
    
    
}

- (void)layoutSubviews
{
    [self.myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.left.equalTo(self);
        make.right.equalTo(self.myTextField.mas_left).with.offset(- 15);
        make.bottom.equalTo(self);
        make.width.equalTo(self.myTextField);
        
    }];
    
    [self.myTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.equalTo(self);
        
    }];
}

-(void)reauto
{
    
    
    
}

@end
